package com.example.cmtwo.service;

import com.example.cmtwo.bean.User;
import com.example.cmtwo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.LinkedList;
import java.util.List;
@Service
public class AdminUserservice {
    @Autowired
    private UserMapper userMapper;

    public List<User> getUserByall()
    {
        List<User> users = new LinkedList<User>();
        try {
           users= userMapper.findalluser();
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
            return users;
        }
        return users;
    }
}
